//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.shbatis.core;

import com.shbatis.session.SqlSession;
import com.shbatis.transaction.Transaction;

import java.util.Map;

public class SqlSessionFactory {

    private Transaction transaction;

    // car.selectCarByCarNum   ShMappedStatement
    private Map<String, ShMappedStatement> mappedStatementMap;


    public SqlSessionFactory() {
    }

    public SqlSessionFactory(Transaction transaction, Map<String, ShMappedStatement> mappedStatementMap) {
        this.transaction = transaction;
        this.mappedStatementMap = mappedStatementMap;
    }

    public SqlSession openSession() {
        transaction.openConnection();
        return new SqlSession(this);
    }

    public Transaction getTransaction() {
        return transaction;
    }

    public void setTransaction(Transaction transaction) {
        this.transaction = transaction;
    }

    public Map<String, ShMappedStatement> getMappedStatementMap() {
        return mappedStatementMap;
    }

    public void setMappedStatementMap(Map<String, ShMappedStatement> mappedStatementMap) {
        this.mappedStatementMap = mappedStatementMap;
    }
}
